<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:th="http://www.thymeleaf.org">
 
<head lang="en">  
    <meta charset="UTF-8" />
    <title></title>
</head>  
<body>  
 <!-- 当gender存在时，选择对应的选项；若gender不存在或为null时，取得customer对象的name-->
 <table>
 <tr>
<td th:switch="${customer.gender?.name()}">
    <span th:case="'MALE'"  th:text="男" >man</span>
    <span th:case="'FEMALE'" th:text="女" > woman</span>
    <span th:case="*">Unknown</span>
</td>
</tr>
</table>
</body>  
</html>  